import { Base } from '../../utils/base.js'

class Pets extends Base {
  constructor() {
    super();
  }

  getMyPets(callback) {
    var allParams = {
      url: 'pets/user',
      type: 'get',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }

  getCollect(pageIndex, callback) {
    var allParams = {
      url: 'pets/mycollect',
      data: { page: pageIndex },
      type: 'get',
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }

  getPetsInfo(id, callback) {
    var allParams = {
      url: 'pets/petsinfo?id=' + id,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParams);
  }

  save(id, param, callback) {
    var allParam = {
      url: 'pets/edit?id=' + id,
      type: 'POST',
      data: param,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(allParam);
  }
}
export { Pets }